<template>
  <el-select placeholder="请选择"
             :disabled="disabled"
             v-bind="$attrs"
             @input="handleInput">
    <el-option v-for="item in feeOptions"
               :key="item.value"
               :label="item.label"
               :value="item.value"
               :disabled="valueSet.includes(item.value)">
    </el-option>
  </el-select>
</template>
<script>
export default {
  name: "AddCost",
  props: {
    valueArr: {
      type: Array,
      default: () => []
    },
    options: {
      type: Array,
      default: () => []
    },
    disabled: {
      type: Boolean,
      default: () => false
    }
  },
  computed: {
    feeOptions () {
      return [...this.options];
    },
    valueSet () {
      return this.valueArr;
    },
  },
  methods: {
    handleInput (value) {
      this.$emit("input", value);
    }
  }
};
</script>
